package cn.yunhe.test;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;

import cn.yunhe.dao.UserDao;
import cn.yunhe.entity.User;
import cn.yunhe.util.SqlSessionFactoryUtil;

public class Demo1 {
	SqlSession session=null;
	@Test
	public void test1(){
		System.out.println("1111");
	}
	@Test
	public void mybatisTest(){
		session=SqlSessionFactoryUtil.getSession();
		UserDao userDao=session.getMapper(UserDao.class);
		List<User> list=userDao.getAllUsers();
		for (User user : list) {
			System.out.println(user.getId()+","+user.getName());
		}
		
	}
}
